
cc.Class({
    extends: cc.Component,

    properties: {
        endItem:cc.Node,
    },

    start () {

    },

    setEndData(list){
        for (let i = 0; i < list.length; i++) {
            let pdata = list[i];

            let node = cc.instantiate(this.endItem);
            let itemlogic = node.getComponent('MajiangEndItem');
            itemlogic.username = pdata.name;
            itemlogic.dianpao = pdata.pao;
            itemlogic.hupai = pdata.hu;
            itemlogic.zimo = pdata.zimo;
            itemlogic.score = pdata.score;

            node.x += i * (node.width + 50);
            node.parent = this.endItem.parent;
            node.active = true;
        }
    }
});
